import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Footer } from './shared/components';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less'],
})
export class AppComponent implements OnInit {
  footerData: Footer[] = [
    {
      icon: '../assets/img/footer/home.png',
      iconActive: '../assets/img/footer/home-active.png',
      title: '首页',
      link: 'home',
    },
    {
      icon: '../assets/img/footer/cart.png',
      iconActive: '../assets/img/footer/cart-active.png',
      title: '购物车',
      link: 'cart',
    },
    {
      icon: '../assets/img/footer/category.png',
      iconActive: '../assets/img/footer/category-active.png',
      title: '分类',
      link: 'category',
    },
    {
      icon: '../assets/img/footer/chart.png',
      iconActive: '../assets/img/footer/chart-active.png',
      title: '聊天',
      link: 'chat',
    },
    {
      icon: '../assets/img/footer/my.png',
      iconActive: '../assets/img/footer/my-active.png',
      title: '我的',
      link: 'personal',
    },
  ];
  constructor(private router: Router) {}

  ngOnInit(): void {}
  handleSelected(data: Footer) {
    this.router.navigate([data.link]);
  }
}
